<?php
// +----------------------------------------------------------------------
// | SparkERP 优秀的进销存系统
// +----------------------------------------------------------------------
// | Copyright (c) 2022~2099 http://erp.sparkshop.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: NickBai  <1902822973@qq.com>
// +----------------------------------------------------------------------
namespace app\controller;

use app\BaseController;
use app\service\LoginService;
use utils\Captcha;

class Login extends BaseController
{
    /**
     * 执行登录
     */
    public function doLogin(LoginService $service)
    {
        return json($service->doLogin(input('post.')));
    }

    /**
     * 登录验证码
     */
    public function captcha(Captcha $captcha)
    {
        return jsonReturn(0, 'success', $captcha->create());
    }
}